package com.yuand.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yuand.entity.SysRole;
import com.yuand.mapper.SysRoleMapper;
import com.yuand.service.SysRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yuandong
 * @since 2021-08-06
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {

    @Autowired
    private SysRoleMapper roleMapper;

    /**
     * 根据用户id 查询该用户所拥有的角色列表
     * @param userId
     * @return
     */
   public List<SysRole> selectRolesByUserId(Integer userId){
        return this.roleMapper.selectRolesByUserId(userId);
    };

}
